var express = require('express');
var router = express.Router();
const { Adminer,addadmin,dilet,gaiadmin,submitadminer } = require('../service/adminerService')
//获取商家数据
router.get('/Adminer', async function (req, res, next) {
    res.send(await Adminer(req.query))
})
//新增商家
router.post('/addadmin', async function (req, res, next) {
    res.send(await addadmin(req.body))
})
//删除商家
router.get('/dilet',async function(req,res,next){
    res.send(await dilet(req.query))
})
//显示修改商家
router.get('/gai',async function(req,res,next){
    res.send(await gaiadmin(req.query))
})
//修改商家
router.post('/submitadminer',async function(req,res,next){
    await submitadminer(req.body)
})
module.exports = router;